1. Field of the Invention
The present invention relates to a lightness correction method which is capable of correcting a digital still color image taken by a digital camera, a surveillance camera, or the like into the optimal dynamic range required.
2. Description of the Related Art
The retinex method has been proposed as a method for correcting lightness information, color information, or the like of a digital still color image. The retinex method models a retina of an eye. In this method, local information of an image is used to correct lightness of the image having biased dynamic range (dynamic characteristic). Specifically, lightness is increased for a portion of an image having low lightness while lightness is decreased for a portion of the image having high lightness, so that the image becomes easier to perceive.
Examples of the retinex method include a single-scale retinex (Daniel J. Jobson, et al., “Properties and Performance of a Center/Surround Retinex”, IEEE Trans. on Image Processing, vol. 6, pp. 451–462, March 1997) and a multiscale retinex (Daniel J. Jobson et al., “A Multiscale Retinex for Bridging the Gap Between Color Images and the Human Observation of Scenes”, IEEE Trans. on Image Processing, vol. 6, pp. 956–976, July 1997).
In the single-scale retinex, the spectral band component Ii(x,y) (i=1,2 . . . ) of a pixel I(x,y) (hereinafter referred to as a subject pixel) in an original image is corrected by a surround function F(x,y) obtained based on information on surround pixels. The result of the retinex operation is represented byRi=log(Ii(x,y))−log[F(x,y)*Ii(x,y)]  (1)where “*” denotes the convolution operation.
In this case, F(x,y) is represented byF(x,y)=Ke−r2/c2  (2)where r denotes the distance between a pixel and a surround pixel (r2=x2+y2), c denotes the scale parameter, and K is the scala coefficient and selected such that F(x,y)dxdy=1, i.e., the total of the surround function is equal to 1.
The result of the single-scale retinex operation, Ri(x,y), is obtained by expressions (1) and (2). Thereafter, the result Ri(x,y) is converted into an appropriate dynamic range by correcting with correction parameters gain and offset, using the following expression (3). A corrected result of a retinex operation, IRi, is represented byIRi=Gain×Ri+Offset  (3).
Thus, in the single-scale retinex (SSR), the spectral band component of a subject pixel is processed based on the surround function. The multiscale retinex (MSR) provides the retinex having N scales for the spectral band component Ii of a subject pixel. In the MSR, the result of the MSR operation is a weighted sum of the results of the SSR operations having the N scales. The result of each SSR is weighted by the weight wn. The result of the MSR, RMSRi is represented by                               R                      MSR            1                          =                              ∑                          n              =              1                        N                    ⁢                                          ⁢                                    ω              n                        ⁢                          R                              n                1                                                                        (        4        )            
Similar to the SSR, the result of the MSR, RMSRi, calculated by expression (4) is converted into an appropriate dynamic range by correcting with the correction parameters gain and offset. A corrected result of the MSR operation, IMSRi, is represented byIMSRi=Gain×RMSRi+Offset  (5).
In the MSR, the calculation of the SSR is performed a given number of times, which is equal to the number of scales (N), so as to correct a subject pixel. In other words, the N surround functions are calculated for a pixel. Therefore, if the number of scales is large, about half of the pixels in the entire image may need to be referred to as the surround pixels so as to perform the MSR operation for a subject pixel. The number of pixels to be referred to increases in proportion to the second power of the length of a scale as well as the length of the image.
The MSR needs the log operation, the exponential operation, and the sum-of-products operation which are required in the convolution operation. The increased number of surround pixels to be referred leads to a vast amount of calculation. The number of accesses to a memory which stores the results of the operations is increased. Moreover, a large volume of memory is required to store information on the two-dimensional surround pixels, intermediate results of the operations, and the like, thereby reducing cost efficiency. The increased number of accesses to a memory is also likely to increase the processing time.
In particular, recently, high picture-quality digital cameras having about one or two mega pixels have been developed. Such cameras require longer time for the MSR operation.